{{template "admin/header.html"}}
<title>站点信息 - GPRESS</title>
{{template "admin/bodystart.html"}}


<section class="section">
	<input type="hidden" id="data" value="{{.Data}}">
	<!-- 分页隐藏域 -->
	<input type="hidden" id="totalCount" value="{{.Page.TotalCount}}">
	<input type="hidden" id="pageCount" value="{{.Page.PageCount}}">


	<div class="container">
		<!-- 搜索表单 -->
		<form id="listForm" class="field is-horizontal" action="{{basePath}}admin/{{.UrlPathParam}}/list" method="GET">
			<div class="field-body">
				<div class="field">
					<div class="control">
						<input class="input is-small" type="text" name="q" placeholder="输入搜索内容...">
						<input type="hidden" id="pageNo" name="pageNo" value="{{.Page.PageNo}}">
					</div>
				</div>
				<div class="field">
					<div class="control">
						<button class="button is-success is-small" type="submit">搜索</button>
						<a href="{{basePath}}admin/{{.UrlPathParam}}/save" class="button is-success is-small"
							type="submit">+新增</a>
					</div>
				</div>
			</div>
		</form>

		<!-- 列表 -->

		<div class="table-content">
			<table class="table is-hoverable is-fullwidth">
				<thead>
					<tr>
						<th>ID</th>
						<th>标题</th>
						<th>名称</th>
						<th>域名</th>
						<th>关键字</th>
						<th>站点描述</th>
						<th>Logo</th>
						<th>Favicon</th>
						<th>底部信息</th>
						<th>排序</th>
						<th>状态</th>
						<th class="pos-sticky">操作</th>
					</tr>
				</thead>
				<tbody>
					<!-- 循环所有的数据 -->
					{{ range $i,$v := .Data }}
					<tr>
						<!-- 获取每一列的值 -->
						<td> {{ .Id }}</td>
						<td> {{ .Title }}</td>
						<td> {{ .Name }}</td>
						<td> {{ .Domain }}</td>
						<td> {{ .Keyword }}</td>
						<td> {{ .Description }}</td>
						<td> {{ .Logo }}</td>
						<td> {{ .Favicon }}</td>
						<td> {{ .Footer }}</td>
						<td> {{ .SortNo }}</td>
						<td> 
							{{if eq .Status 0 }}
							列表不显示
							{{else if eq .Status 1 }}
							公开
							{{else if eq .Status 2 }}
							私密
							{{else}}
							未知
							{{end}}
						</td>
						<td class="pos-sticky">
							<div style="margin-bottom: 10px;">
								<a class="button is-success is-light is-small"
									href="{{basePath}}admin/{{$.UrlPathParam}}/update?id={{$v.Id}}">编辑</a>
								<a class="button is-link is-light is-small"
									href="{{basePath}}admin/{{$.UrlPathParam}}/look?id={{$v.Id}}">查看</a>
								<input type="button" class="button is-danger is-small" onclick="deleteFunc(this.id,'{{basePath}}admin/{{$.UrlPathParam}}/delete')"
									id="{{$v.Id}}" value="删除"></input>
							</div>
						</td>
					</tr>
					{{end }}
				</tbody>
			</table>
		</div>
		<!-- 分页条 -->
		<div class="page"></div>
	</div>
</section>

<script>
	// 加载分页
	initPage()

</script>

{{template "admin/bodyend.html"}}